package by.dvrudenko.avtobaza.services;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.dvrudenko.avtobaza.dataaccess.en.Restriction;
import by.dvrudenko.avtobaza.datamodel.Car;

public interface CarService {
	
	@Transactional
	void saveOrUpdate(Car car);

	@Transactional
	void delete(Car car);

	@Transactional
	void deleteAll();
	
	@Transactional
	void changeBooleanValue(SingularAttribute<Car, Boolean> attr,Long id , Boolean bool);
	
	Car get(Long id);
	
	Long getCount();
	
	Car getRadomCar();
	
    List<Car> getAllCars(SingularAttribute<Car, ?> attr, boolean ascending, int startRecord, int pageSize);
    
    List<Car> getAllCars();
    
    //все работоспособные машиы в гараже или на задании
    List<Car> getAllCarsInConditionByWork(Boolean work);

    List<Car> getAllCarInWork(Boolean work);
    
    List<Car> getAllCarInCondition(Boolean condition);
    
    List<Car> getAllCarByYear(Timestamp year , Restriction restriction); 
    
    List<Car> getAllCarByCarryingCapacity(Integer carryingCapacity, Restriction restriction); 
    
    List<Car> getAllCarByVolumeCapacity(Integer volumeCapacity, Restriction restriction);
    
    List<Car> getAllCarsInConditionByCapacity(Integer capacity);
    
    List<Car> getAllCarsInConditionByVolume (Integer capacity);
    
    // выбрать все рабочие и не назадании машины с сортировкой по объему и весу не дописал метод
    List<Car> getAllFreeCarsByCapacityAndVolume(Integer capacity, Integer volume);
    
    
}
